package com.zzw.thread;

public class JoinThread extends Thread {

	public JoinThread(String name){
		super(name);
	}
	
	public void run(){
		for(int i = 0;i < 100;i ++){
			System.out.println(getName() + "" + i);
		}
	}
	
	public static void main(String[] args) throws Exception {
		new JoinThread("").start();
		for(int i = 0;i < 20;i++){
			if(i == 10){
				JoinThread it = new JoinThread("");
				it.start();
				it.join();
			}
			System.out.println(Thread.currentThread().getName() + "" + i);
		}
	}
}